.class public Lcom/vividsolutions/jts/geom/GeometryCollectionIterator;
.super Ljava/lang/Object;
.source "GeometryCollectionIterator.java"

# interfaces
.implements Ljava/util/Iterator;


# instance fields
.field private atStart:Z

.field private index:I

.field private max:I

.field private parent:Lcom/vividsolutions/jts/geom/Geometry;

.field private subcollectionIterator:Lcom/vividsolutions/jts/geom/GeometryCollectionIterator;


# direct methods
.method public constructor <init>(Lcom/vividsolutions/jts/geom/Geometry;)V
    .locals 1

    .line 84
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 85
    iput-object p1, p0, Lcom/vividsolutions/jts/geom/GeometryCollectionIterator;->parent:Lcom/vividsolutions/jts/geom/Geometry;

    const/4 v0, 0x1

    .line 86
    iput-boolean v0, p0, Lcom/vividsolutions/jts/geom/GeometryCollectionIterator;->atStart:Z

    const/4 v0, 0x0

    .line 87
    iput v0, p0, Lcom/vividsolutions/jts/geom/GeometryCollectionIterator;->index:I

    .line 88
    invoke-virtual {p1}, Lcom/vividsolutions/jts/geom/Geometry;->getNumGeometries()I

    move-result p1

    iput p1, p0, Lcom/vividsolutions/jts/geom/GeometryCollectionIterator;->max:I

    return-void
.end method


# virtual methods
.method public hasNext()Z
    .locals 3

    .line 92
    iget-boolean v0, p0, Lcom/vividsolutions/jts/geom/GeometryCollectionIterator;->atStart:Z

    const/4 v1, 0x1

    if-eqz v0, :cond_0

    return v1

    .line 95
    :cond_0
    iget-object v0, p0, Lcom/vividsolutions/jts/geom/GeometryCollectionIterator;->subcollectionIterator:Lcom/vividsolutions/jts/geom/GeometryCollectionIterator;

    if-eqz v0, :cond_2

    .line 96
    invoke-virtual {v0}, Lcom/vividsolutions/jts/geom/GeometryCollectionIterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_1

    return v1

    :cond_1
    const/4 v0, 0x0

    .line 99
    iput-object v0, p0, Lcom/vividsolutions/jts/geom/GeometryCollectionIterator;->subcollectionIterator:Lcom/vividsolutions/jts/geom/GeometryCollectionIterator;

    .line 101
    :cond_2
    iget v0, p0, Lcom/vividsolutions/jts/geom/GeometryCollectionIterator;->index:I

    iget v2, p0, Lcom/vividsolutions/jts/geom/GeometryCollectionIterator;->max:I

    if-lt v0, v2, :cond_3

    const/4 v0, 0x0

    return v0

    :cond_3
    return v1
.end method

.method public next()Ljava/lang/Object;
    .locals 3

    .line 109
    iget-boolean v0, p0, Lcom/vividsolutions/jts/geom/GeometryCollectionIterator;->atStart:Z

    if-eqz v0, :cond_0

    const/4 v0, 0x0

    .line 110
    iput-boolean v0, p0, Lcom/vividsolutions/jts/geom/GeometryCollectionIterator;->atStart:Z

    .line 111
    iget-object v0, p0, Lcom/vividsolutions/jts/geom/GeometryCollectionIterator;->parent:Lcom/vividsolutions/jts/geom/Geometry;

    return-object v0

    .line 113
    :cond_0
    iget-object v0, p0, Lcom/vividsolutions/jts/geom/GeometryCollectionIterator;->subcollectionIterator:Lcom/vividsolutions/jts/geom/GeometryCollectionIterator;

    if-eqz v0, :cond_2

    .line 114
    invoke-virtual {v0}, Lcom/vividsolutions/jts/geom/GeometryCollectionIterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_1

    .line 115
    iget-object v0, p0, Lcom/vividsolutions/jts/geom/GeometryCollectionIterator;->subcollectionIterator:Lcom/vividsolutions/jts/geom/GeometryCollectionIterator;

    invoke-virtual {v0}, Lcom/vividsolutions/jts/geom/GeometryCollectionIterator;->next()Ljava/lang/Object;

    move-result-object v0

    return-object v0

    :cond_1
    const/4 v0, 0x0

    .line 118
    iput-object v0, p0, Lcom/vividsolutions/jts/geom/GeometryCollectionIterator;->subcollectionIterator:Lcom/vividsolutions/jts/geom/GeometryCollectionIterator;

    .line 121
    :cond_2
    iget v0, p0, Lcom/vividsolutions/jts/geom/GeometryCollectionIterator;->index:I

    iget v1, p0, Lcom/vividsolutions/jts/geom/GeometryCollectionIterator;->max:I

    if-ge v0, v1, :cond_4

    .line 124
    iget-object v1, p0, Lcom/vividsolutions/jts/geom/GeometryCollectionIterator;->parent:Lcom/vividsolutions/jts/geom/Geometry;

    add-int/lit8 v2, v0, 0x1

    iput v2, p0, Lcom/vividsolutions/jts/geom/GeometryCollectionIterator;->index:I

    invoke-virtual {v1, v0}, Lcom/vividsolutions/jts/geom/Geometry;->getGeometryN(I)Lcom/vividsolutions/jts/geom/Geometry;

    move-result-object v0

    .line 125
    instance-of v1, v0, Lcom/vividsolutions/jts/geom/GeometryCollection;

    if-eqz v1, :cond_3

    .line 126
    new-instance v1, Lcom/vividsolutions/jts/geom/GeometryCollectionIterator;

    check-cast v0, Lcom/vividsolutions/jts/geom/GeometryCollection;

    invoke-direct {v1, v0}, Lcom/vividsolutions/jts/geom/GeometryCollectionIterator;-><init>(Lcom/vividsolutions/jts/geom/Geometry;)V

    iput-object v1, p0, Lcom/vividsolutions/jts/geom/GeometryCollectionIterator;->subcollectionIterator:Lcom/vividsolutions/jts/geom/GeometryCollectionIterator;

    .line 128
    iget-object v0, p0, Lcom/vividsolutions/jts/geom/GeometryCollectionIterator;->subcollectionIterator:Lcom/vividsolutions/jts/geom/GeometryCollectionIterator;

    invoke-virtual {v0}, Lcom/vividsolutions/jts/geom/GeometryCollectionIterator;->next()Ljava/lang/Object;

    move-result-object v0

    :cond_3
    return-object v0

    .line 122
    :cond_4
    new-instance v0, Ljava/util/NoSuchElementException;

    invoke-direct {v0}, Ljava/util/NoSuchElementException;-><init>()V

    throw v0
.end method

.method public remove()V
    .locals 2

    .line 139
    new-instance v0, Ljava/lang/UnsupportedOperationException;

    const-class v1, Lcom/vividsolutions/jts/geom/GeometryCollectionIterator;

    invoke-virtual {v1}, Ljava/lang/Class;->getName()Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V

    throw v0
.end method
